/**
 * 
 */
package com.taobao.snowsnow.hibernate.service.impl;

import java.util.List;

import com.taobao.snowsnow.hibernate.dao.PostFeeDao;
import com.taobao.snowsnow.hibernate.pojo.Express;
import com.taobao.snowsnow.hibernate.pojo.PostFee;
import com.taobao.snowsnow.hibernate.service.PostFeeService;

/**
 * @author Tux
 *
 * 创建时间: 2011-4-29 上午09:55:17
 */
public class PostFeeServiceImpl extends BaseServiceImpl implements PostFeeService {
	private PostFeeDao pdao;
	
	public List<PostFee> findAll() throws Exception {
		try {
			return pdao.findAll();
		} catch(Exception e) {
			e.printStackTrace();
			throw e;
		}
	}

	public PostFee findById(int id) throws Exception {
		try {
			return pdao.findById(id);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findById(int id)");
			throw e;
		}
	}
	
	public List<PostFee> findByName(String name) throws Exception {
		try {
			return pdao.findByName(name);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findByName(String name)");
			throw e;
		}
	}

	public long getTotal() throws Exception  {
		try {
			return pdao.getTotal();
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at getTotal()");
			throw e;
		}
	}

	public List<PostFee> paging(int page, int limit) throws Exception  {
		try {
			return pdao.paging(page, limit);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at paging(int page, int limit)");
			throw e;
		}
	}

	public void setPdao(PostFeeDao edao) {
		this.pdao = edao;
	}

	public PostFeeDao getPdao() {
		return pdao;
	}

	@Override
	public PostFee getFirstObject() throws Exception {
		try {
			return pdao.getFirstObject();
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("PostFee getFirstObject()");
			throw e;
		}
	}

	@Override
	public PostFee getLastObject() throws Exception {
		try {
			return pdao.getLastObject();
		} catch(Exception e) {
			e.printStackTrace();
			System.out.println("PostFee getLastObject()");
			throw e;
		}
	}

	@Override
	public PostFee findByNamePrecise(String name) throws Exception {
		try {
			return pdao.findByNamePrecise(name);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("PostFee getLastObject()");
			throw e;
		}
	}

	@Override
	public PostFee findByStateAndExpress(Express express, String state)
			throws Exception {
		try {
			return pdao.findByStateAndExpress(express, state);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("PostFee getLastObject()");
			throw e;
		}
	}
}
